
<!DOCTYPE html>
<html>
   
  <head>
   <link rel=stylesheet href="{{asset('car/Css/qikoo-v.css')}}">
    <link rel=stylesheet href="{{asset('car/Css/v3203b5.css')}}">
    <link rel=stylesheet href="{{asset('car/Css/qiku.css')}}">
    <link rel=stylesheet href="{{asset('car/Css/store.css')}}">
    <link rel=stylesheet href="{{asset('car/Css/qikoo_user.css')}}">
   <title>360商城</title>
      <style type="text/css">
        .cur{'border','solid 1px  #8ABE5C'}
        
      </style>
  </head>
  
  <body id="body">
      <div class="mod-header">
        <div class="topbox" id="gotop">
             <div class="top-container">
                 <ul>
                    <li class="topbox-item leftitem" style="margin-left:-10px">
                        <a data-monitor="home_top_buy" target="_blank" href="#">企业采购</a></li>
                    <li class="topbox-item leftitem">
                        <a data-monitor="home_top_help" target="_blank" href="#">帮助中心</a></li>
                    <li class="topbox-item leftitem">
                        <a data-monitor="home_top_collect" class="js-connect" href="javascript:;">收藏本站</a></li>
                    <li class="topbox-item leftitem">
                        <a data-monitor="home_top_in" href="http://mcom/help/product" target="_blank">商品入驻</a></li>
                    <li class="topbox-item leftitem">
                        <a data-monitor="home_top_old" href="http://wall.360.com/apply" target="_blank">老人手环申请</a></li>
                    <li class="topbox-item leftitem">
                        <a data-monitor="home_top_app" target="_blank" href="http://m.360.com/xia/zai" class="telshop">
                            <i>
                            </i>手机360商城</a>
                    </li>
                    <li class="topbox-item rightitem" style="margin-right:-10px">
                        <a data-monitor="home_top_order" href="/home/order" target="_blank">我的订单</a></li>
                    <li class="topbox-item rightitem hassx">
                        <a href="http://mall.360.com/f" target="_blank" data-monitor="home_top_fcode">F码购买</a></li>
                    <li class="topbox-item rightitem navloginbox">
                        <div class="loginbefore nloginWrap">
                            <a class="btn-login-pop" href="javascript:;" id="land" data-monitor="home_top_login">@if(session()->get("username")) {{session()->get("username")->username}} @endif</a>
                            <a class="btn-reg-pop" onclick="return false" href="javascript:;" data-monitor="home_top_registe" id="reg"></a></div>
                        <div class="loginafter loginWrap" style="display:none">
                            <span class="top-uname popUsername">@if(session()->get("username")) {{session()->get("username")->username}} @endif</span>
                            <div class="popbox">
                                <a class="top-uname popUsername" href="http://mall.360.com/user" target="_blank" data-monitor="home_top_user">@if(session()->get("username")) {{session()->get("username")->username}} @endif</a>
                                <ul class="topuserbox">
                                    <li>
                                        <a href="/home/order" target="_blank" data-monitor="home_top_myorder">我的订单</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_mycoupon">我的优惠券</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_myfavorite">我的喜欢</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_try">我的试用</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_point">试用积分</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_book">我的预约</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_address">收货地址</a></li>
                                    <li>
                                        <a href="" target="_blank" data-monitor="home_top_set">账号设置</a></li>
                                    <li>
                                        <a href="/Home/login/loginout" data-monitor="home_top_out">退出登录</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                </ul>
        </div>
    </div>      
      <div class="top-container">
        <div class="header-logo">
          <a class=sellogo href="http://mall.360.com" data-monitor=home_title_logo>
            <img src="{{asset('car/Picture/t013cfce5d46cdb1b5f.png')}}"></a>
        </div>
        <div class="header-tools">
        
             <div class="suggest-box">
              <form id=__mall_search_form__ action="/search/">
                <input type=text id=__mall_search_kw__ class=suggest name=q>
                <input type=submit value="" class="search-btn" id=__mall_search_btn__ data-monitor=home_search_button></form>
              <p class=searchkey>
                <a href="http://mall.360.com/shouji/q5" target=_blank>360手机Q5</a>
                <a href="http://mall.360.com/ac/badilong" target=_blank>360儿童手表5C</a>
                <a href="http://mall.360.com/shop/item?item_id=5799719b4ae38d2fa0ac5ee7" target=_blank>360儿童机器人</a>
                <a href="http://mall.360.com/rush/item?item_id=57876cb3215ea061b38eb52f" target=_blank>360手机N4S</a></p>
            </div>

        </div>
      </div>
      <div class=navbox>
        <div class="top-container">
          <div class=sublistbox></div>
          <ul class="navbar column-list clearfix">
            <li class="top-item topfirst">
              <a data-monitor=home_fenlei_allgoods href="http://mall.360.com/search/?sort=weight" target=_blank>全部智能酷品</a>
              <li class="top-item" data-type=1>
                <a href="http://mall.360.com/ac/360shouji" data-monitor=home_title_goods1 target=_blank>手机</a>
                <li class="top-item" data-type=2>
                  <a href="http://che.mall.360.com/index.html" data-monitor=home_title_goods2 target=_blank>行车记录仪</a>
                  <li class="top-item" data-type=3>
                    <a href="http://kids.360.com/index.html?utm_source=sydbdh_03&utm_medium=inside" data-monitor=home_title_goods3 target=_blank>儿童手表</a>
                    <li class="top-item" data-type=4>
                      <a data-monitor=home_title_goods4 href="http://jia.mall.360.com/?utm_source=sydbdh_04&utm_medium=inside" target=_blank>智能摄像机</a>
                      <li class="top-item" data-type=5>
                        <a data-monitor=home_title_goods5 href="http://luyou.mall.360.com/?utm_source=sydbdh_05&utm_medium=inside" target=_blank>路由器</a>
                        <li class="top-item" data-type=6>
                          <a data-monitor=home_title_goods5 href="#" target=_blank>儿童机器人</a>
                          <li class="top-item" data-type=7>
                            <a data-monitor=home_title_goods6 target=_blank href="#">智品牌</a>
                            <li class="top-item" data-type=8>
                              <a data-monitor=home_title_goods7 target=_blank href="http://mall.360.com/activity/duobao_erweima">一元夺宝</a>
                              <li class="top-item" data-type=9>
                                <a data-monitor=home_title_goods8 target=_blank href="http://mall.360.com/try/list">试用</a>
                                <li class="top-item" data-type=10>
                                  <a data-monitor=home_title_goods9 href="http://bbs.360.cn">社区</a></ul>
        </div>
      </div>
    </div>
   


    <style>body{background:#f2f2f2}</style>
    <div class="c m-t-30" style="clear:both">
      <div class="content mall_head">
        <div class="mall_cont">
          <div class="mall_modw">
            <div class="hd">
              <h3>收货地址</h3>
              <span style="color:red;font-size:14px;padding:10px">温馨提示：为了保证您的权益，防止黄牛倒卖，订单进入正在配货状态将不能修改收货地址和发票信息！</span></div>
  
                   @if (session('success'))
                     <div  id ="warning"class="mod-dialog" style="left: 483.5px; top: 640px;">
                    <div class="dialog-nav">
                      <span class="dialog-title">提示</span>
                      <a class="dialog-close" onclick="return false" id="no"></a>
                    </div>
                    <div class="dialog-main">
                      <div class="dialog-content">
                        <p id="content">{{ session('success')}}</p>
                      </div>
                      <div class="dialog-console clearfix_new">
                        <a onclick="return false;" href="#" class="console-btn-confirm">确定</a></div>
                    </div>
                  </div>
                @endif
          
                @if(session('error'))
                 <div  id ="warning"class="mod-dialog" style="left: 483.5px; top: 640px;">
                    <div class="dialog-nav">
                      <span class="dialog-title">提示</span>
                      <a class="dialog-close" onclick="return false" id="no"></a>
                    </div>
                    <div class="dialog-main">
                      <div class="dialog-content">
                        <p id="content">{{ session('error')}}</p>
                      </div>
                      <div class="dialog-console clearfix_new">
                        <a onclick="return false;" href="#" class="console-btn-confirm">确定</a></div>
                    </div>
                  </div>
                @endif

            <div class="bd">
              <div class="consigneeinfo addr-box">
                <div class="mod-consignee-info" data-token="cdf108">
              
                @if(session()->get('address'))
                  @foreach(session()->get('address') as $v=> $address)
                  <div class="consignee-item consignee_item_new item-checked" id="mm" style="display:block;">
                     <input type="hidden" value="{{$address['id']}}"  id="mn" name="consignee_edite_id">
                     <span class="item-action"> 
                        <a data-monitor="user_address_editor" title="删除"   class="action_delete" href="{{url('/Home/address/del')}}/{{$v}}">删除 &nbsp;</a> &nbsp;
                     </span>
                   
                    <span class="item-action"> 
                      <input type="hidden" value="{{$v}}"  class="edite" > 
                      <a data-monitor="user_address_editor" title="编辑" class="action_edit" href="javascript:viod(0);">编辑</a> &nbsp;
                     </span>

                    <input class="input-radio"  name="consignee_radio" id="consigneeRadioAddNew" value="-1" type="radio">
                    <label for="consigneeRadioAddNew" id="m" class="dizhi">
                    {{$address['consignee']}} ,{{$address['consignee_province']}} {{$address['consignee_city']}} {{$address['consignee_address']}},{{$address['consignee_mobile']}}

                    </label>
                   


                   </div>
                  @endforeach
               @endif
  
            <!-- 添加地址 -->
                   <div class="consignee-item consignee_item_new item-checked" id="add1"style="display:block;">
                        <i class="input-radio-view" style="display:none">
                        </i>
                        <input class="input-radio" checked="checked" name="consignee_radio" id="consigneeRadioAddNew" value="-1" type="radio">
                        <label for="consigneeRadioAddNew">
                            使用新地址
                        </label>
                    </div>
                           
            <span class="consignee-btn-add aaa" id='add2' title="添加新地址" style="display:none;cursor:pointer;"></span>
                   
                  <div  id="addplace" style="display:none;" >
                    <form action="/Home/address/insert" method="post" id="doForm">
                      <div class="add-row">
                      <label class="consignee-add-label" for="onsignee_add_realname">
                          <b>
                            *
                          </b>收货人姓名

                      </label>
                          <input name="consignee" id="consignees"  class="consignee-add-text" placeholder="收货人姓名" type="text">
                      </div>


                      <div class="add-row m-t-10">
                        <label class="consignee-add-label" for="consignee_add_province">
                          <b>*</b>地址</label>
                       
                        <select class="consignee-add-select" name="consignee_province" id="province">

                        </select>
                         <select class="consignee-add-select" name="consignee_city" id="city">
                                
                        </select>
                        <textarea class="consignee-add-address" name="consignee_address" placeholder="路名或街道地址，门牌号"></textarea>
                      </div>
                      <div class="add-row m-t-10">
                        <label class="consignee-add-label" for="consignee_add_postcode">邮政编码</label>
                        <input name="postcode" id="code" class="consignee-add-text" placeholder="6位邮政编码"  maxlength="6" type="text"></div>
                      <div class="add-row m-t-10">
                        <label class="consignee-add-label" for="consignee_add_mobile">
                          <b>*</b>手机号码</label>
                           <input name="consignee_mobile" id="phone" class="consignee-add-text" placeholder="11位手机号" type="text">

                        </div>
                     {{csrf_field()}}
                      
                      <div class="add-row m-t-10">
                        <p class="m-t-20">
                          <button type="submit" id="btnAlert" class="mod-btn-green">
                                        保存
                          </button>
                          <button type="button" id="consigneeCancelBtn" class="mod-btn-gray">
                                        取消
                           </button>
                        </p>
                     </div>
                    </form>
              
                  </div>
               
              </div>

          <!-- 用户地址的添加 -->
          <script src="/back/js/libs/jquery-1.8.3.min.js"></script>
           <script type="text/javascript">
                 //获取焦点时显示的效果
                  $('input').focus(function(){
                      //设置边框颜色
                     $(this).css('border','solid 1px  #8ABE5C');
                    })
                  $('textarea').focus(function(){
                       $(this).css('border','solid 1px  #8ABE5C');
        
                  })
           //当失去焦点时

           var CU = false;//姓名
            var PU = false;//地址
            var HU = false;//邮政
            var DU = false;//手机号码
            //点击添加按钮
            // <input name="consignee_add_addr_id" value="" type="hidden">
        $('.action_delete').click(function(){

              //获取id    
              $(this).parents('#mm').find('#m').addClass('cur');
               $(this).siblings().removeClass('cur');
        })

          //获取用户名
          $('input[name=consignee]').blur(function(){
              //获取其值
              var uv =$(this).val();
              //判断输入的内容
                if(uv == ''){
                   $('#warning').css('display','block');
                   var v ="姓名不能为空";
                   $('#content').html(v);
                   CU = false;
                } else{
                    $('#warning').css('display','none');
                    $(this).css('border','');
                      CU = true;
                }
            
            })

          //获取地址
          $('textarea').blur(function(){
              //获取其值
              var address =$(this).val();
               //判断输入的内容
               if(address == ''){
                   $('#warning').css('display','block');
                   var v ="地址不能为空";
                   $('#content').html(v);
                   PU = false;
                } else{
                    $('#warning').css('display','none');
                    $(this).css('border','');
                     PU = true;
                } 
           
          })
         //获取邮编
          $('#code').blur(function(){
              //获取其值
          
              var codes =$(this).val();
              var reg = /^\d{6}$/;
              var res = reg.test(codes);

               //删除断输入的内容
               if(codes == ''){
                  //邮箱不能为空
                   $('#warning').css('display','block');
                    var v ="邮箱不能为空";
                   $('#content').html(v);
                   HU = false;//邮政
                } else if(!res){
                   //邮箱格式不正确
                    $('#warning').css('display','block');
                    var v ="邮箱格式不正确";
                   $('#content').html(v);
                   HU = false;//邮政
                } else{

                   $('#warning').css('display','none');
                    $(this).css('border','');
                    HU = true;//邮政
                }
           
          })

          //获取手机号码
              $('#phone').blur(function(){
              //获取其值
          
              var phones =$(this).val();
              var reg = /^1[3|5|4|7|8]\d{9}$/;
              var res = reg.test(phones);

               //删除断输入的内容
               if(phones == ''){
                  //手机不能为空
                   $('#warning').css('display','block');
                    var v ="手机号码不能为空";
                   $('#content').html(v);
                   DU = false;//手机号码
                } else if(!res){
                   //邮箱格式不正确
                    $('#warning').css('display','block');
                    var v ="手机格式不正确";
                   $('#content').html(v);
                   DU = false;//手机号码
                } else{

                   $('#warning').css('display','none');
                    $(this).css('border','');
                    DU = true;//手机号码
                }
           
          })

          $('#doForm').submit(function(){
            //判断结果
            if(CU && PU && DU && HU) {
              return true;
            } else if ($('#doForm').attr("action")== "/Home/address/update?id="+id){

              return true;
            } else{
              return false;
            }

            //阻止默认行为
            return false;
          })
              
          // 用户的地址添加地址的提交
            //点击添加地址按钮
            $("#add1").click(function(){
                $(this).css('display','none');
                $('#add2').css("display","block");
                $('#addplace').css("display",'block');
                $('#consignees').attr('value','');
                $('textarea').attr('value','');
                $('#code').attr('value','');
                $('#phone').attr('value','');
            })

            // 点击提交按钮
          $("#btnAlert").click(function(){
                //改变的样式
                $('#add1').css("display","block");
                $('#add2').css("display","none");
                $('#addplace').css("display",'none');

          })    
          //点击取消按钮
          $("#consigneeCancelBtn").click(function(){
                //改变的样式
                $('#add1').css("display","block");
                $('#add2').css("display","none");
                $('#addplace').css("display",'none');
                $(this).parents('#mm').find('#m').css('border','solid 1px  #8ABE5C')
          })   
          //弹框取消按钮
          $("#no").click(function(){
             $('#warning').css('display','none');
          })

          /*
          *用户地址的修改 
          */
              var mid = $('#edite').val();

          $('.action_edit').click(function(){
             $(this).parents('#mm').find('#m').css('border','solid 1px  #8ABE5C');

             $('#add1').css("display","none");
            $('#addplace').css("display",'block'); //显示编辑框
              //获取id
             var id= $(this).parents('#mm').find('#mn').val();
              var mid = $(this).parents('#mm').find('.edite').val();
            
             //提交出问题"&mid="+mid)
             $('#doForm').attr("action","/Home/address/update?id="+id+"&mid="+mid);
             //发送ajax 
             $.get("{{ url('/Home/address/edite') }}",{id:id},function(data){
                      var json = eval(data);

                      $("#consignees").attr("value",json.consignee);//收货人
                      
                      $("#province").attr("value",json.pid);//收货人的省份

                       $("#city").attr("value",json.cid);//收货人的市

                     $("textarea").attr("value",json.postcode); //收货人的地址
                   
                     $("#phone").attr("value",json.consignee_mobile); //收货人的电话
                  
                     $("#code").attr({value:json.postcode}); //收货人的邮编
            

             },'json')

          })

        /*
         * 地址的修改
         */
        $('.dizhi').click(function(){
          //获取地址
           var res= $(this).html(); 
            $(this).css('border','solid 1px  #8ABE5C');
            // $(this).siblings().css('');
           //显示到下面地址
           $("#mailTo").html(res);
           //显示被选中
            
        })




          //二级联动效果
          //获取元素
          var ct = document.getElementById('province');

          var ar = document.getElementById('city');

          var city = ['北京','上海','山东','河南'];

          var area = [
                  ['昌平','海淀','朝阳','房山'],
                  ['浦东新','虹口','静安','徐汇'],
                  ['德州','青岛','威海','烟台'],
                  ['郑州','南阳','开封','安阳']

                ]
                
          var str = '';
          for (var i = 0; i < city.length; i++) {
            
            str += "<option value="+i+">"+city[i]+"</option>";
          };

          //添加文本
          ct.innerHTML = str;

          ct.onchange = function(){

            //获取当前城市的值
            var v = this.value;

            //获取区县的数组
            var av = area[v];

            var res ='';
            //遍历
            for (var i = 0; i < av.length; i++) {
              
              res += "<option value="+i+">"+av[i]+"</option>";
            };

            ar.innerHTML = res;
          }



            </script>

                </div>
            </div>
          </div>
        

<!-- 提示框 -->
<div  id ="warning"class="mod-dialog" style="left: 483.5px; top: 640px; display:none;">
  <div class="dialog-nav">
    <span class="dialog-title">提示</span>
    <a class="dialog-close" onclick="return false" href="#"></a>
  </div>
  <div class="dialog-main">
    <div class="dialog-content">
      <p id="content"></p>
    </div>
    <div class="dialog-console clearfix_new">
      <a onclick="return false;" href="#" class="console-btn-confirm">确定</a></div>
  </div>
</div>
        

         <div class="mall_modw">
            <div class="hd">
              <h3>支付方式</h3></div>
            <div class="bd">
              <div class="onlinePay">
                <div class="formEle">
                  <div class="eleRadio">
                    <span class="rd rdc"></span>
                    <input checked="checked" name="payment" class="hookbox ip" value="在线支付" type="radio">
                    <label>在线支付</label></div>
                </div>
              </div>
            </div>
          </div>
          <div class="mall_modw">
            <div class="hd">
              <h3>配送方式</h3></div>
            <div class="bd">
              <div class="onlinePay">
                <div class="formEle">
                  <div class="eleRadio">
                    <span class="rd rdc"></span>
                    <input checked="checked" name="mailCharge" class="hookbox ip" value="加配送费0元" type="radio">
                    <label>免费配送</label></div>
                </div>
              </div>
            </div>
          </div>
          <div class="mall_modw">
           
            <div class="bd">
              <div class="onlinePay">
                <div class="formEle">
                  <div class="eleRadioa">
                    <div class="eleRadio">
                      <span class="rd rdc"></span>
                      <input checked="checked" id="nInvoice" name="invoice[0]" class="hookbox ip" value="不开发票" type="radio">
                      <label>不开发票</label></div>
                    <div class="eleRadio">
                      <span class="rd"></span>
                      <input name="invoice[0]" id="yInvoice" class="hookbox ip" value="普通发票" type="radio">
                      <label>普通发票</label></div>
                  </div>
                </div>
                <div class="con">
                  <div class="txt">发票内容：购买商品明细</div>
                  <div class="txt">发票抬头：请确认单位名称正确，以免因名称错误耽搁您的报销。</div>
                  <div class="sltcate">
                    <a href="javascript:void(0);" id="sltcate_person" class="selected" data-monitor="gotoorder_invoice_personal">个人</a>
                    <a href="javascript:void(0);" id="sltcate_company" data-monitor="gotoorder_invoice_unit">单位</a></div>
                  <div class="invoiceInfo">
                    <div class="txt">单位名称：</div>
                    <input id="companyName" maxlength="30" type="text">
                    <span class="company_empty" style="color:red;display:none;font-size:13px;padding-left:10px">单位名称不能为空</span></div>
                </div>
              </div>
            </div>
          </div>
          <style>.zp_wrap{background-color:#F5F5F5;margin-top:18px;padding:13px;position:relative}.zp_list{height:75px;line-height:75px;margin-bottom:13px}.zp_l1{float:left;width:420px}.zp_none{float:left;text-align:center;width:40px}.zp_sanjiao{border:15px solid #fff;border-bottom:15px solid #F5F5F5;height:0;left:40px;position:absolute;top:-30px;width:0}.zp_list:last-child{margin-bottom:0}.cont li.gout{width:895px}</style>
          <div class="mall_modw">
            <div class="hd nobdr">
              <h3>商品清单</h3></div>
          
        <div class=bd>
        <div class=cartList>
          <div class=hd>
            <div class=col1>商品信息</div> <div class=col2>单价</div> <div class=col3>数量</div>
            <div class=col3>小计</div><div class=col4>操作</div></div>
          <style>.wrap_row{border-bottom:1px dashed #eee}.icon_zp{background-color:#F95E38;color:#fff}.icon_zp,.icon_zp_no{border-radius:2px;display:inline-block;padding:2px 5px}.icon_zp_no{background-color:#ededed;color:#333}.zp_title{margin:6px 0 2px}.zp_chose{color:#c00;cursor:pointer}.zp_info{line-height:16px;overflow:hidden;padding-left:15px;text-align:left}.row_list{background-color:#F5F5F5}.wrap_zp{margin-bottom:15px;margin-top:-15px;position:relative}.zp_sanjiao{border:15px solid #fff;border-bottom:15px solid #F5F5F5;height:0;left:67px;position:absolute;width:0}.zp_space{height:30px}.dn{display:none}.wrap_row:last-child{border-bottom:0}.row_list .r3{font-size:16px}.cartList .bd .row{border-bottom:0}</style>
          
          <div class=bd>
        
            @foreach(session()->get("shoplist") as $v)
       <form class="cart nobottommargin clearfix" method="get" action='/Home/address/index' enctype='multipart/form-data'>{{ csrf_field() }}
           <div class=wrap_row data-item_id="56e38c335efb116a378b4568" id="fpa">

              <div class=row data-item_id="56e38c335efb116a378b4568" data-limit="5" data-store="222">             
                <div class=r0>  <input type="hidden"  name="id" value="{{$v->id}}" >
                 </div>
                <div class=r1>
                  <img class="item-img" src="{{$v->goodspic}}">
                  <a class="item-namexx" href="/upload/s_174701473605567.jpg" target=_blank>
                      {{$v->goodsname}}
                  </a>
                  </a>
                   <input type="hidden"   name="goodsname" value="{{$v->goodsname}}" >

                </div>
                <div class=r2>
                 <!-- 商品的单价 -->
                  <span id="price">{{$v->goodsprice}}</span>元
                  <input type="hidden"   name="goodsprice" value="{{$v->goodsprice}}" >
                </div>
               
                <div class=r3>
                  
                  <div class=gcIpt data-monitor=shopcart_number_click>
                  <!-- 数量的减少 -->
                    <a href="javascript:void(0);" class=decrement></a>
                        <!-- 商品的数量 -->

                       <input type=text class=goodsCount name="num" value="{{$v->m}}" >
                          
                      <!-- 数量的增加 -->
                    <a href="javascript:void(0);" class=increment></a>
                    
                      <!-- 商品的库存量 -->
                     <input type=hidden class=max name="gnum" value="{{$v->goodsnum}}">

                     <input type=hidden class=max name="id" value="{{$v->id}}">
                  </div>
             
                  </div>
               
                <div class=r4>
                  <!-- 商品的小计 -->
                  <span class="amount">{{$v->goodsprice*$v->m}}</span>元</div>
                <div class=r5>
                   &nbsp;&nbsp;&nbsp;
                  <a href="{{url('/Home/car/del')}}/{{$v->id}}" data-monitor=shopcart_delete_click class=delOrder item_id="56e38c335efb116a378b4568">删除</a>  &nbsp;&nbsp;&nbsp;
                  <!-- 多选框 -->
                  <input type="checkbox" class=goodsCount name='check[]' checked>
                </div>
             </div>
          </div>
       
      @endforeach<!-- 商品总计 -->
          </div>
          <div class=gAmount  >商品总计：
            <span id="total">0</span>元</div>

          <div class=btn>
         
              <div id="mailTo">
             李耀,河南省安阳市滑县慈周寨乡慈二村,15637842515
             </div>
             <br/><!-- ="/Home/address/opp"  -->
             <br/>
            <a href id="order"class=b2 title="立马下单" data-monitor=shopcart_placeorder_click>立即下单</a>
          
            </div>

          </div>
        </form>
      </div>
    </div>

   <script type="text/javascript">
      //获取商品的库存
      var gnum = {{$v->goodsnum}};
    
      //做一个商品的数量加法
      // alert($);
      $('.increment').click(function(){
            //商品数量加一
            
             var v = $(this).prev().val();
             //alert(v);
              v++;
              //商品的最大不能超过库存数量
              if(v > gnum) {v =gum}
              // 写到商品数量里
              $(this).prev().val(v);

           //获取id
           var id= $(this).parents('#fpa').find('.r0').find('input[name="id"]').val();
              //alert(id);
              //ajax 
             $.get("{{url('/Home/car/change')}}",{v:v,id:id},function(data){
                      console.log(data); 
              });
       
              //获取商品的单价
              var price =$(this).parents('.r3').prev().find('#price').html();
            
              //计算小计并写入小计
            var prices =price*v
               $(this).parents('#fpa').find('.r4').find('.amount').html(prices);
              total();
      })
      //做一个商品的数量减法
      //获取商品的数量
      $('.decrement').click(function(){
        //商品数量减一
        var v =$(this).next().val(); 
          v--;
        //商品最小为1
        if(v < 1){v =1};
        $(this).next().val(v);

        //获取id
        var id= $(this).parents('#fpa').find('.r0').find('input[name="id"]').val();
              // alert(id);
              //ajax 
             $.get("{{url('/Home/car/change')}}",{v:v,id:id},function(data){
                      console.log(data); 
              });


        //获取商品的价格
         var price =parseFloat($(this).parents('.r3').prev().find('#price').html());
     
        //计算小计 并写入
          var prices =price*v;
          $(this).parents('#fpa').find('.r4').find('.amount').html(prices);

            total();
      })
      //获取总金额
      var jine =total();
      
      $('.goodsCount').html(jine);

    function total(){

       var tot = 0;
        $('input[type="checkbox"]:checked').each(function(){
            
            var jine =parseFloat($(this).parents('.r5').prev().find('.amount').html());
           
            tot += jine;   
        }); 
          
    
        $('#total').html(tot);
   }

    //点击生成订单
    $('#order').click(function(){
        //获取总金额
      var pri = $('#total').html();
        //获取地址
        var addre =$("#mailTo").html();
        //发送ajax
        $.get('/Home/address/order',{pri:pri,addre:addre},function(data){
              if(data){
                  
              }else{
                alert('下单失败');
              }

        })

    })




   </script>




             
          </div>
        </div>
      </div>
    </div>
   

    <div class="mod-footer">
        <div class="foot-bannerw">
            <div class="foot-banner clearfix">
                <div class="banner-item">

                        <i class="icon1">7</i>7天无理由退货</div>
                <div class="banner-item">

                        <i class="icon2">15</i>15天免费换货</div>
                <div class="banner-item">
                    <i class="icon3">包</i>满99元包邮</div>
                <div class="banner-item">

                        <i class="icon4">服</i>手机特色服务</div>
            </div>
        </div>
        <div class="foot-containerw">
            <div class="foot-container clearfix">
                <dl class="foot-con">
                    <dt data-monitor="home_foot_freshman">帮助中心</dt>
                    <dd data-monitor="home_help_freshman">
                        <a target="_blank" href="#" rel="nofollow">用户注册</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">用户登录与密码找回</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">购买指南</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">支付方式</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">配送与说明</a></dd>
                </dl>
                <dl class="foot-con">
                    <dt data-monitor="home_foot_help">售后服务</dt>
                    <dd data-monitor="home_help_help">
                        <a target="_blank" href="#" rel="nofollow">7 日无理由退货</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">质量问题 15 日内换货</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">保修条款</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">服务流程</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">安迷之家</a></dd>
                </dl>
                <dl class="foot-con">
                    <dt data-monitor="home_foot_guide">特色服务</dt>
                    <dd data-monitor="home_help_guide">
                        <a target="_blank" href="#" rel="nofollow">F码通道</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">免费试用</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">360 生态</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">一元夺宝</a></dd>
                </dl>
                <dl class="foot-con">
                    <dt data-monitor="home_foot_tuiguang">推广合作</dt>
                    <dd data-monitor="home_help_try">
                        <a target="_blank" href="#" rel="nofollow">商品入驻</a></dd>
                    <dd>
                        <a target="_blank" href="#" rel="nofollow">大客户采购</a></dd>
                </dl>
                <dl class="foot-con">
                    <dt data-monitor="home_foot_try">关注360商城</dt>
                    <dd data-monitor="home_help_try">
                        <a target="_blank" href="#" rel="nofollow">360商城大事记</a></dd>
                </dl>
                <dl class="foot-con contactus">
                    <dt>联系我们</dt>
                    <dd class="servicebox">
                        <a href="javascript:;" onclick="showServiceSelector();return false" class="inline-kefu">
                            <img src="/header_files/t019c3c42d7b0ea4f41.png"></a>
                        <a href="javascript:;" target="_blank" class="weixin">
                            <img src="/header_files/t0113493aa732f72837.png">
                            <span class="wxtips"><img src="/header_files/t01d06b994b8798623c.jpg"></span>
                        </a>
                        <a class="weibo" data-monitor="home_foot_weibo" href="http://weibo.com/qikoo360" target="_blank">
                            <img src="/header_files/t0128093bd494ffc7e9.png">
                            <span class="wxtips"><img src="/header_files/t013f6db48422a373d6.jpg"></span>
                        </a>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="footer-copyright">360商城©2013-2016 360公司版权所有 京ICP备08010314号-43 京公网安备11000002000006号</div></div>
    <div class="slidebar" id="slidebar">
        <ul>
            <li class="rfeedback">
                <a target="_blank" href="#" data-monitor="right_fankui_click">用户体验</a></li>
            <li class="rtips rWeChat">
                <a href="javascript:;">微信关注</a>
                <div class="rtipscont rWeChattips">
                    <span class="arrowr-bg"></span>
                    <span class="arrowr"></span>
                    <img src="/header_files/t01d06b994b8798623c.jpg">
                    <p class="tiptext">扫码关注官方微信
                        <br>先人一步知晓促销活动</p></div>
            </li>
            <li class="rtips rstore">
                <a href="javascript:;">手机商城</a>
                <div class="rtipscont rstoretips">
                    <span class="arrowr-bg"></span>
                    <span class="arrowr"></span>
                    <img src="/header_files/t013df41dbfac4d5924.jpg">
                    <p class="tiptext">客户端首次登录
                        <span>送188元现金券礼包</span></p>
                </div>
            </li>
            <li style="visibility:hidden;" class="topback">
                <a data-monitor="right_top_click" href="javascript:;" class="gotop">返回顶部</a></li>
        </ul>
    </div>
    <div id="serviceSelectorMask"></div>
    <div class="fixed dialog" id="serviceSelector">
        <span class="icon close" onclick="hideServiceSelector()"></span>
        <p class="title">产品咨询</p>
        <p class="description">咨询时间
            <em>8:00-22:00</em></p>
        <ul class="flex">
            <li class="phone" onclick="openNtalker(true)">360手机&amp;配件</li>
            <li class="watch" onclick="openNtalker()">360儿童手表</li>
            <li class="recorder" onclick="openNtalker()">360行车记录仪</li>
            <li class="camera" onclick="openNtalker()">360智能摄像头</li>
            <li class="more" onclick="openNtalker()">其他产品</li>
        </ul>

    </div>
    
</body>
<script src ="/header_files/header.js"></script>

   
    
  </body>

</html>